<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <button class="btn">登录</button>
    <input type="text">
    <script>
        var btn = document.querySelector('.btn')
        var ipt = document.querySelector('input')
        btn.onclick = function(){
            btn.disabled = true
            ipt.value = '登录按钮已禁止'
            ipt.style.color = '#ccc'
        }
    </script>
</body>
</html>